var app = getApp();
Page(Object.assign({},{
    data:{
        datalist : [],
        inited : false,
        info : {},
        goodslist : [],
        shoplist : [],
		siteroot : app.siteInfo.siteroot.replace('app/index.php', ''),uniacid: app.siteInfo.uniacid,
    },
    onLoad:function(options){
        var self = this;
        
        var cid = options.id ? options.id : ( options.scene ? options.scene : 0 );
        app.com.auth(function(user){
            app.com.http('yhm','POST',{op:'info',id:cid},0,false,'','',function(res){
                if (!res.data.errno) {
                    self.setData({
                        Pagetheme : res.data.data.params.style,
                        params : res.data.data.params,
                        info : res.data.data.info,
                        goodslist : res.data.data.goodslist ? res.data.data.goodslist : [],
                        shoplist : res.data.data.shoplist ? res.data.data.shoplist : [],
                    },function(){
                        self.setData({
                            inited : true,
                        });
                    });

                    // 关闭下拉刷新
                    wx.stopPullDownRefresh();
                }else{
                    app.com.alert(res.data.message,function(){
                        app.com.backPage(options.zfid);
                    });
                }
            });
        });
    },
    toggleDetail(){
        this.setData({
            showDetail : !this.data.showDetail,
        })
    },
    onPullDownRefresh: function () {
        wx.stopPullDownRefresh();
    },
    chooseCard(e){
        this.setData({
            t : e.detail.value
        })
    },
    name(e){
        this.setData({
            name : e.detail.value
        })
    },
    tel(e){
        this.setData({
            tel : e.detail.value
        })
    },
    location : function( e ){
        app.com.location( e );
    },
    otherapp : function( e ){
        app.com.otherapp( e );
    },
    navigateto : function( e ){
        app.com.navigateto( e );
    },
    redirectto : function( e ){
        app.com.redirectto( e );
    },    
    callphone : function(e){
        app.com.callphone( e );
    },
    showimages : function( e ){
        app.com.showimages( e );
    },
    FormIdsubmit : function(e){
        if( app.globalData.formarr.length <= 20 ) app.globalData.formarr.push(e.detail.formId);
    },
    copy(e){
        wx.setClipboardData({
            data : e.currentTarget.dataset.copy
        })
    },

}))